package us.ajg0702.leaderboards.libs.spigot;

import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;


public class VersionSupport {
    public static String getVersion() {
        return Bukkit.getVersion().split("\\(MC: ")[1].split("\\)")[0];
    }

    public static int getMinorVersion() {
        return Integer.parseInt(getVersion().split("\\.")[1]);
    }


    public static void sendActionBar(Player ply, String message) {
        if (getMinorVersion() >= 11) {
            ply.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message));
        } else if (getMinorVersion() >= 8) {
            ActionBar.send(ply, message);
        }
    }
}


*Location:D:\User\Xuan\Downloads\ajLeaderboards-1.3.3.jar\\us\ajg0702\leaderboards\libs\spigot\VersionSupport.class
 *Java compiler version:8(52.0)
         *JD-Core Version:1.1.3
